﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace WMS_Api.Areas.MesSystem.Models
{
    /// <summary>
    /// 
    /// </summary>
    public class MesMaterialRequisition
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        [Required(ErrorMessage = "物料编码不允许为空!")]
        public string part_no { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        [Required(ErrorMessage = "物料名称不允许为空!")]
        public string part_name { get; set; }

        /// <summary>
        /// 规格型号，包含特殊字符、空格等
        /// </summary>
        public string part_spec { get; set; }

        /// <summary>
        /// 材质
        /// </summary>
        public string material { get; set; }

        /// <summary>
        /// 外径
        /// </summary>
        public string out_diam { get; set; }

        /// <summary>
        /// 长度
        /// </summary>
        public string length { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal qty { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class MainData
    {
        /// <summary>
        /// 领料单号
        /// </summary>
        [Required(ErrorMessage = "领料单号不允许为空!")]
        public string material_requisition_no { get; set; }

        /// <summary>
        /// 生产通知单号
        /// </summary>
        public string notice_no { get; set; }

        /// <summary>
        ///  创建时间（unix时间戳）
        /// </summary>
        [RegularExpression(@"^\d{13}$", ErrorMessage = "创建时间create_time为13位的时间戳!")]
        public long create_time { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class MaterialRequisitionData
    {
        /// <summary>
        /// 
        /// </summary>
        public MainData main { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public List<MesMaterialRequisition> details { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class MesMaterialRequisitionExtendModel : BaseInfoModel
    {
        /// <summary>
        /// 
        /// </summary>
        public List<MaterialRequisitionData> data { get; set; }
    }
}